package com.sq.partner.manager.dao;

import java.util.Map;

import com.sq.partner.manager.mybatis.model.GatewayRole;
import com.sq.partner.manager.mybatis.model.GatewayRoleMenu;
import com.sq.partner.manager.mybatis.model.GatewayUser;
import com.sq.partner.manager.mybatis.model.GatewayUserRole;
import com.sq.partner.manager.util.Page;

/**
 * 角色管理
 * @author zhihuizhao
 *
 */
public interface IGatewayRoleDao {

	/**
	 * 查询所有角色
	 * @param page
	 * @param pageIndex
	 * @param user
	 * @return
	 * @throws Exception
	 */
	Page queryPage(Page page,Integer pageIndex, GatewayRole role,GatewayUser user) throws Exception;
	
	/**
	 * 删除角色
	 * @param role
	 * @return
	 * @throws Exception
	 */
	boolean deleteRole(GatewayRole role) throws Exception;

	/**
	 * 删除用户角色表中角色ID
	 * @param userRole
	 * @throws Exception
	 */
	boolean delUserRoleRoleid(GatewayUserRole   userRole) throws Exception;
	/**
	 * 增加角色
	 * @param role
	 * @return
	 * @throws Exception
	 */
	boolean addRole(GatewayRole role) throws Exception;
	/**
	 * 检查角色是否存在
	 * @return
	 */
	GatewayRole queryRoleNameExistsOrNot(Map<String,String> map) throws Exception;
	
	
	/**
	 * 修改角色
	 * @return
	 */
	boolean modifyRole(GatewayRole role) throws Exception;
	
	Long addRoleAndReturnKey(GatewayRole role)throws Exception;
}
